import { createRouter, createWebHashHistory } from 'vue-router';

import Home from '@/components/Home.vue';
import Login from '@/components/Login.vue';
import HelloWorld from '@/components/HelloWorld.vue';

// 配置路由映射关系
const routes = [
    { path: '/', redirect: '/login' },
    { path: '/login', component: Login },
    { path: '/home/:id', component: Home },
    { path: '/hello', component: HelloWorld },
];

// 创建路由实例
const router = createRouter({
    routes,
    history: createWebHashHistory()
});

export default router;